// 导入
import { request } from "@/utils/request";

// 导出
export const deleteUserApi = (params: USER.DeleteUserPayloadType) => {
  return request<API.Result>("/user/delete", {
    method: "DELETE",
    params,
  });
};

export const postUserApi = (body: USER.PostUserPayloadType) => {
  return request<API.Result>("/user/create", {
    method: "POST",
    body,
  });
};

export const getUserApi = (params: USER.GetUserPayloadType) => {
  return request<USER.GetUserResType>("/user/index", {
    method: "GET",
    params,
  });
};

export const putUserAssignApi = (body: USER.PutUserAssignPayloadType) => {
  return request<API.Result>("/user/assign", {
    method: "PUT",
    body,
  });
};

export const putUserApi = (body: USER.PutUserPayloadType) => {
  return request<API.Result>("/user/update", {
    method: "PUT",
    body,
  });
};
